#ifndef ADAPTER_H
#define ADAPTER_H
#include <iostream>

class Target {
public:
  virtual void request() = 0;
};

class Adaptee {
public:
  virtual void SpecialRequest() = 0;
};

class Adaptee1 : public Adaptee {
public:
  void SpecialRequest() {
    std::cout << "Adaptee1" << std::endl;
  }
};

class Adaptee2 : public Adaptee {
public:
  void SpecialRequest() {
    std::cout << "Adaptee2" << std::endl;
  }
};

class ClassAdapter : public Target, public Adaptee1 {
public:
  virtual void request() {
    std::cout << "ClassAdapter : " << std::endl;
    SpecialRequest();
    std::cout << std::endl;
  }  
};

class ObjectAdapter : public Target {
public:
  ObjectAdapter(Adaptee* adaptee) : adaptee_(adaptee) {}

  virtual void request() {
    std::cout << "ObjectAdapter : " << std::endl;
    adaptee_->SpecialRequest();
    std::cout << std::endl;
  }
private:
  Adaptee* adaptee_; 
};

#endif // ADAPTER_H
